package com.hry.myapp.utils;

import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JsonUtils {
	
	public Map<String, Object> jsonToMap(String json) throws JsonMappingException, JsonProcessingException{
		
        ObjectMapper mapper = new ObjectMapper();
        Map<String,Object> resultMap = mapper.readValue(json, new TypeReference<HashMap<String,Object>>(){});
                
		return resultMap;
	}

}
